Skip to content

test(parse): wrap unit tests of symmetric definition parsing in mod tests#23

Merged
hyperfinitism merged 1 commit intomainfrom
ci/wrap-unit-tests
Mar 28, 2026
Merged

test(parse): wrap unit tests of symmetric definition parsing in mod tests#23
hyperfinitism merged 1 commit intomainfrom
ci/wrap-unit-tests

Conversation

@hyperfinitism
Copy link
Copy Markdown
Owner

This PR wraps #[test] functions in #[cfg(test)] mod tests { ... } to follow idiomatic Rust test organisation. This ensures test code is excluded from release builds.

@hyperfinitism hyperfinitism requested a review from Copilot March 28, 2026 13:54
@hyperfinitism hyperfinitism self-assigned this Mar 28, 2026
@hyperfinitism hyperfinitism added ci/cd CI/CD related items refactor Refactoring without functional changes labels Mar 28, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reorganizes unit tests in src/parse.rs by moving the symmetric definition parsing #[test] functions under a #[cfg(test)] mod tests module, ensuring test code is excluded from non-test builds while keeping the tests co-located with the parsing logic.

Changes:

  • Wrapped existing symmetric definition parsing unit tests into #[cfg(test)] mod tests.
  • Added use super::*; so tests can access module items after being nested.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the test suite in src/parse.rs by wrapping existing unit tests within a dedicated #[cfg(test)] mod tests module, following standard Rust conventions. The reviewer suggested using assert_eq! instead of assert!(matches!(...)) to improve the clarity of error messages when tests fail.

Signed-off-by: Takuma IMAMURA <209989118+hyperfinitism@users.noreply.github.com>
@hyperfinitism hyperfinitism merged commit 0276d77 into main Mar 28, 2026
22 checks passed
@hyperfinitism hyperfinitism deleted the ci/wrap-unit-tests branch March 29, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI/CD related items refactor Refactoring without functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants